package com.yl.project.lvyou.spot.service.impl;

import java.util.List;
import com.yl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yl.project.lvyou.spot.mapper.ScenicSpotMapper;
import com.yl.project.lvyou.spot.domain.ScenicSpot;
import com.yl.project.lvyou.spot.service.IScenicSpotService;
import com.yl.common.utils.text.Convert;
import com.yl.framework.config.BaseService;

/**
 * 景区信息Service业务层处理
 * 
 * @author yl
 * @date 2025-03-11
 */
@Service
public class ScenicSpotServiceImpl extends BaseService<ScenicSpot> implements IScenicSpotService 
{
    @Autowired
    private ScenicSpotMapper scenicSpotMapper;

    /**
     * 查询景区信息
     * 
     * @param id 景区信息ID
     * @return 景区信息
     */
    @Override
    public ScenicSpot selectScenicSpotById(Long id)
    {
        return scenicSpotMapper.selectScenicSpotById(id);
    }

    /**
     * 查询景区信息列表
     * 
     * @param scenicSpot 景区信息
     * @return 景区信息
     */
    @Override
    public List<ScenicSpot> selectScenicSpotList(ScenicSpot scenicSpot)
    {
        return scenicSpotMapper.selectScenicSpotList(scenicSpot);
    }

    /**
     * 新增景区信息
     * 
     * @param scenicSpot 景区信息
     * @return 结果
     */
    @Override
    public int insertScenicSpot(ScenicSpot scenicSpot)
    {
        scenicSpot.setCreateTime(DateUtils.getNowDate());
        return scenicSpotMapper.insertScenicSpot(scenicSpot);
    }

    /**
     * 修改景区信息
     * 
     * @param scenicSpot 景区信息
     * @return 结果
     */
    @Override
    public int updateScenicSpot(ScenicSpot scenicSpot)
    {
        scenicSpot.setUpdateTime(DateUtils.getNowDate());
        return scenicSpotMapper.updateScenicSpot(scenicSpot);
    }

    /**
     * 删除景区信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteScenicSpotByIds(String ids)
    {
        return scenicSpotMapper.deleteScenicSpotByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除景区信息信息
     * 
     * @param id 景区信息ID
     * @return 结果
     */
    @Override
    public int deleteScenicSpotById(Long id)
    {
        return scenicSpotMapper.deleteScenicSpotById(id);
    }

    @Override
    public List<ScenicSpot> selectScenicSpotNews(ScenicSpot scenicSpot) {
        return scenicSpotMapper.selectScenicSpotNews(scenicSpot);
    }

    @Override
    public ScenicSpot selectScenicSpotNewsById(Long id) {
        return scenicSpotMapper.selectScenicSpotNewsById(id);
    }

    @Override
    public List<ScenicSpot> selectScenicSpotListTj(ScenicSpot scenicSpot) {
        return scenicSpotMapper.selectScenicSpotListTj(scenicSpot);
    }
}
